import request from '@/utils/request'
import qs from 'qs';

// 查询数据类别列表
export function queryTreeList(query) {
  return request({
    url: '/system/b/datatype/queryTreeList',
    method: 'get',
    params: query
  })
}

// 查询数据类别列表
export function queryList(query) {
  return request({
    url: '/system/b/redissensitivedata/queryDataLevelList',
    method: 'get',
    params: query
  })
}

export function getLevel(typeId) {
  return request({
    url: '/system/b/datalevel/query',
    method: 'get',
    params: typeId
  })
}

// 查询数据分级列表
export function listLevel(query) {
  return request({
    url: '/system/b/datalevel/queryPageList',
    method: 'get',
    params: query
  })
}

// 新增数据分级
export function addLevel(data) {
  return request({
    url: '/system/b/datalevel/add',
    method: 'post',
    headers: {
      "Content-Type": 'application/x-www-form-urlencoded;charset=UTF-8'
    },
    data: qs.stringify(data)
  })
}

// 编辑数据分级
export function updateLevel(data) {
  return request({
    url: '/system/b/datalevel/update',
    method: 'post',
    headers: {
      "Content-Type": 'application/x-www-form-urlencoded;charset=UTF-8'
    },
    data: qs.stringify(data)
  })
}

// 删除数据分级
export function delLevel(data) {
  return request({
    url: '/system/b/datalevel/delete',
    method: 'post',
    headers: {
      "Content-Type": 'application/x-www-form-urlencoded;charset=UTF-8'
    },
    data: qs.stringify(data)
  })
}
// 删除数据前校验
export function deleteForCheck(data) {
  return request({
    url: '/system/b/datalevel/deleteCheck',
    method: 'post',
    headers: {
      "Content-Type": 'application/x-www-form-urlencoded;charset=UTF-8'
    },
    data: qs.stringify(data)
  })
}
